<?php

namespace app\admin\validate;

use think\Validate;

class Detection extends Validate
{
    /**
     * 验证规则
     */
    protected $rule = [
        'unit_id' => 'require',
        'address' => 'require',
        'name' => 'require',
        'phone'    => 'require',
        'detection_json'   => 'require',
    ];

    /**
     * 提示消息
     */
    protected $message = [
    ];

    /**
     * 字段描述
     */
    protected $field = [
    ];

    /**
     * 验证场景
     */
    protected $scene = [
        'add'  => ['unit_id', 'address', 'name', 'phone','detection_json'],
        'edit' => ['unit_id', 'address', 'name', 'phone', 'detection_json'],
    ];

    public function __construct(array $rules = [], $message = [], $field = [])
    {
        $this->field = [
            'unit_id' => __('受检方名称'),
            'address' => __('受检方地址'),
            'name' => __('联系人'),
            'phone'    => __('联系电话'),
            'detection_json'   => __('检测结果定性'),
        ];
        $this->message = array_merge($this->message, []);
        parent::__construct($rules, $message, $field);
    }
    
}
